﻿using System;
using UnityEngine;
using UnityEngine.Audio;

// Token: 0x0200014E RID: 334
[AddComponentMenu("RVP/C#/Scene Controllers/Time Master", 1)]
[DisallowMultipleComponent]
public class TimeMaster : MonoBehaviour
{
	// Token: 0x06000602 RID: 1538 RVA: 0x00030C45 File Offset: 0x0002EE45
	private void Awake()
	{
		this.initialFixedTime = Time.fixedDeltaTime;
		if (!this.destroyOnLoad)
		{
			UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
		}
	}

	// Token: 0x06000603 RID: 1539 RVA: 0x00030C68 File Offset: 0x0002EE68
	private void Update()
	{
		if (this.masterMixer)
		{
			this.masterMixer.SetFloat("MasterPitch", Time.timeScale);
		}
	}

	// Token: 0x06000604 RID: 1540 RVA: 0x00030C90 File Offset: 0x0002EE90
	private void FixedUpdate()
	{
		Time.fixedDeltaTime = Time.timeScale * this.initialFixedTime;
		TimeMaster.fixedTimeFactor = 0.01f / this.initialFixedTime;
		TimeMaster.inverseFixedTimeFactor = 1f / TimeMaster.fixedTimeFactor;
	}

	// Token: 0x0400093B RID: 2363
	private float initialFixedTime;

	// Token: 0x0400093C RID: 2364
	[Tooltip("Master audio mixer")]
	public AudioMixer masterMixer;

	// Token: 0x0400093D RID: 2365
	public bool destroyOnLoad;

	// Token: 0x0400093E RID: 2366
	public static float fixedTimeFactor;

	// Token: 0x0400093F RID: 2367
	public static float inverseFixedTimeFactor;
}
